package com.lyp.crm.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lyp.crm.dao.JournalMapper;
import com.lyp.crm.entity.Fenye;
import com.lyp.crm.entity.Journal;
@Service
public class JournalImp implements Journaldao{
	@Autowired
	private JournalMapper journalMapper;
	@Override
	public Fenye<Journal> SelectJournal(Fenye<Journal> fenye) {
		
		Integer count = journalMapper.SelectJournalCount(fenye);
		List<Journal> list = journalMapper.SelectJournal(fenye);
		fenye.setRows(list);
		fenye.setTotal(count);
		return fenye;
	}
	public Fenye<Journal> SelectJournal1(Fenye<Journal> fenye) {
		
		Integer count = journalMapper.SelectJournalCount1(fenye);
		List<Journal> list = journalMapper.SelectJournal1(fenye);
		fenye.setRows(list);
		fenye.setTotal(count);
		return fenye;
	}
	@Override
	public Integer insertJournal(Journal journal) {
		
		return journalMapper.insertJournal(journal);
	}

	@Override
	public Integer deleteJournal(Integer jid) {
	
		return journalMapper.deleteJournal(jid);
	}

	@Override
	public Integer updateJournal(Journal journal) {
		
		return journalMapper.updateJournal(journal);
	}

}
